using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Environment = System.Environment;
using System.IO;
using System.Threading.Tasks;
using SQLite;

namespace WisdriContactsAndroid
{
    public static class SQLiteHelper
    {
        private static List<PERSON> result;

        public static List<PERSON> GetPersonData()
        {
            if (result == null)
            {
                var docFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                var dbFile = Path.Combine(docFolder, "contacts.db");

                using (var conn = new SQLiteConnection(dbFile))
                {
                    result = conn.Query<PERSON>("select * from PERSON");
                }


            }
            return result;
        }
    }
}

